<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
	<h:body>
		<h:form>
	<h1>Componenti</h1>
	
	 <p:dataTable id="componenti" var="cmp" value="#{tipicomponente.listcomp}" paginator="true" rows="5"  
                 selection="#{tipicomponente.compDTO}" rowKey="#{cmp.idProdotto}">  
  
        <f:facet name="header">  
            Seleziona componente da eliminare  
        </f:facet>  
  
        <p:column selectionMode="single" style="width:2%" />  
  
  
        <p:column headerText="Id" style="width:25%">  
            #{cmp.idProdotto}  
        </p:column>  
  
        <p:column headerText="Nome" style="width:25%">  
            #{cmp.nome}  
        </p:column>
    </p:dataTable>  
                <p:commandButton value="Cancella" action="#{tipicomponente.eliminaComponente()}" />      
    </h:form>
    	</h:body>
    
</html>